home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’96 / O Boy / Source / ProgressProc_hi.cp < prev    next >
Encoding:
Text File  |  1996-06-21  |  2.2 KB  |  91 lines  |  [TEXT/R*ch]

  1. /*
  2.     ProgressProc_hi
  3.     © Bob Boylan 1996
  4.  
  5.     Revision History
  6.     MacHack 1996        Initial creation
  7. */
  8.  
  9. #include "ProgressProc_hi.h"
  10. #include "O Boy.h"
  11. #include "OBoy_hi.h"
  12. #include "AEPrint.h"
  13. #include "string.h"
  14. //    -----------------------------------------------------------------
  15. //    ctor    
  16. //
  17. ProgressProc_hi::ProgressProc_hi( OBoy_hi *inHICollector )
  18.     : _HICollector(  inHICollector )
  19. {
  20. }
  21.  
  22. //    -----------------------------------------------------------------
  23. //    dtor    
  24. //
  25. ProgressProc_hi::~ProgressProc_hi()
  26. {}
  27. //    -----------------------------------------------------------------
  28. //    UserCancelled
  29. //
  30. Boolean
  31. ProgressProc_hi::UserCancelled()
  32. {
  33.     DoEvents();
  34.     return OBoy_hi::_CancelWasIssued;
  35. }
  36. //    -----------------------------------------------------------------
  37. //    BeginUpdate
  38. //
  39. void
  40. ProgressProc_hi::BeginUpdate()
  41. {
  42.     StPort    thePort( _HICollector->GetWindowP() );
  43.     StPen    thePen;
  44.     thePen.Reset();
  45.  
  46.     LDelRow((*(_HICollector->GetListH()))->dataBounds.bottom,0,_HICollector->GetListH());
  47. }
  48. //    -----------------------------------------------------------------
  49. //    EndUpdate
  50. //
  51. void
  52. ProgressProc_hi::EndUpdate()
  53. {
  54. }
  55.  
  56. //    -----------------------------------------------------------------
  57. //    NewSubModel
  58. //
  59. void
  60. ProgressProc_hi::NewSubModel( Clone_ut< AEObj_pd > inAEobj )
  61. {
  62.     StPort    thePort( _HICollector->GetWindowP() );
  63.     StPen    thePen;
  64.     thePen.Reset();
  65.  
  66.     string theName = (*inAEobj).GetName();
  67.     Cell    theCell = {(*(_HICollector->GetListH()))->dataBounds.bottom,0};
  68.     LAddRow(1,theCell.v, _HICollector->GetListH() );
  69.     LSetCell( theName.c_str(), theName.length(), theCell, _HICollector->GetListH() );
  70.     
  71.     _HICollector->NewSubModel( inAEobj );
  72. }
  73. //    -----------------------------------------------------------------
  74. //    NewPropertyValue
  75. //
  76. void
  77. ProgressProc_hi::NewPropertyValue( Clone_ut<PropertyValue_pd> inPropertyValue )
  78. {
  79.     StPort    thePort( _HICollector->GetWindowP() );
  80.     StPen    thePen;
  81.     thePen.Reset();
  82.  
  83.     _HICollector->NewPropertyValue( inPropertyValue );
  84.     string thePropAsString;
  85.     thePropAsString = (*inPropertyValue)._PropertyName + string(":") + Asstring( *inPropertyValue );
  86.  
  87.     Cell    theCell = {(*(_HICollector->GetListH()))->dataBounds.bottom,0};
  88.     LAddRow(1,theCell.v, _HICollector->GetListH() );
  89.     LSetCell( thePropAsString.c_str(), min(100L,(long)thePropAsString.length()), theCell, _HICollector->GetListH() );
  90. }
  91.